package leetcode;

import javax.swing.tree.TreeCellRenderer;
import java.net.SocketOption;

public class _9_PalindromeNumber {
    class Solution {
        public boolean isPalindrome(int x) {
            if (x < 0) return false;
            int compare = 0;
            int ope = x;
            int tail = 0;
            while (ope != 0){
                tail = ope % 10;
                compare *= 10;
                compare += tail;
                ope /= 10;
            }
            System.out.println("x:"+x+"compar:"+compare);
            if (compare == x){
                return true;
            }else return false;
        }
    }

    public Solution getSolution(){return new Solution();}

    public static void main(String args[]){
        _9_PalindromeNumber c = new _9_PalindromeNumber();
        _9_PalindromeNumber.Solution s = c.getSolution();
        int x = 101;
        System.out.println(s.isPalindrome(x));
    }
}
